package com.mipo.service;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.mipo.dao.imp.EmployeeDAO;
import com.mipo.dao.imp.EmployeeDAOImp;
import com.mipo.vo.Employee;

public class WriteMessageService extends HttpServlet {
	public void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		HttpSession session = request.getSession();
		Employee emp = (Employee) session.getAttribute("tzx");
		EmployeeDAO dao = new EmployeeDAOImp();
		try {
			List<Employee> list = dao.queryEmps(emp);
			
			request.setAttribute("emps", list);
			request.getRequestDispatcher("mess/writeMessage.jsp").forward(
					request, response);
		} catch (Exception e) {
			e.printStackTrace();
		}

	}

}
